Conversation
|
I'm not super keen on this actually: if we add |
|
You can chain |
|
@hdgarrood Would you accept a PR for a generalized, fused |
|
Yes, that sounds great 👍 |
|
Yeah, that sounds like a much better solution. I'll hopefully have something by the end of day. |
|
@natefaubion I took a shot at implementing this and quickly realised that a law abiding for any Do you have any suggestions for tackling that? I came up with slightly different semantics for zip that seems to make it possible to have both applicative and monad instances, and wrote up a sample implementation. This version of zip doesn't drop elements when one of the arrays is bigger than the other. Instead, it extends the shorter array by repeating its last element. As far as I can tell, this satisfies the applicative and monad laws, and is still useful. For example, you can zip together arrays of the same size and get results identical to regular zip. There are other constructions that I considered, but this one has the advantage of being a newtype over Arrays. Thoughts? |
No description provided.